<?php ini_set("precision","3"); ?>

<div class="column-left">

    <!-- HEADER -->
    <?php echo image_tag("/uploads/player/".$player->getDefImg(), array('alt'=>$player, 'style'=>'max-width:200px;max-height:150px;float:left;padding:1px;border:1px solid #eee;'))?>
   	<?php $team = Doctrine::getTable('BbTeams')->findOneById($player->getTeamId()); ?>
    <div style="margin-left:15px;" class="left">
        <h6 style="padding:5px 0;color:#000;"><?php echo $player->getFullname()?></h6>
        <hr style="border:0;border-top:1px solid #eee;"/>
        
        #<?php echo $player->getNumber()?> &nbsp; | &nbsp; 
        <?php echo $player->getBbPositions()?> &nbsp; | &nbsp; 
        <a href="<?php echo url_for('@team_show?name='.$player->getBbTeams())?>"><?php echo $player->getBbTeams()?></a>
		
        <br clear="all">
        
        <ul class="player-info" style="float:left; margin-right:6px;">
            <li><span>Төрсөн:</span> <?php echo $player->getBirthday()?> (Нас: 33<?php ?>) &nbsp; </li>
            <li><span>Төрсөн газар:</span><?php echo $player->getBirthPlace()?></li>
            <li><span>Өндөр:</span> <?php echo $player->getHeight()?> см &nbsp; <span>Жин:</span> <?php echo $player->getWeight()?> кг</li>
            <li><span>Боловсрол:</span> <?php echo $player->getEducation()?></li>
            <li><span>Туршлага:</span> <?php echo $player->getExperience()?></li>            
        </ul>
   		
        <div id="stat_snapshot" style="float:left;">
		<?php $stats = Doctrine::getTable('BbPlayerStat')->getAvgStat($player->getId(), $season=$seasonId)?>
		 <?php
         $gp = 0;
         $areb = 0;  
         $aast = 0;  
         $apts = 0;  
      	 foreach ( $stats as $stat ):
      		$areb += $stat->getReb();
      		$aast += $stat->getAst();
      		$apts += $stat->getPts();
      		$gp++;  
      	 endforeach;
      	 
      	 $areb = $areb / $gp; 
      	 $aast = $aast / $gp; 
      	 $apts = $apts / $gp; 
      	?>
			<ul class="keystats">            
	            <li><strong>Оноо</strong><?php echo $apts?></li>
	            <li><strong>Смб</strong><?php echo $areb?></li>
	            <li><strong>Дам</strong><?php echo $aast?></li>
	        </ul>
	        <?php echo image_tag("/uploads/team/".$team->getDefImg(), array('alt'=>$team, 'style'=>'max-width:40px;max-height:40px;float:right;padding:4px 4px 4px 4px;border:1px solid #eee;'))?>
		</div>
	</div>
    
    <br clear="all">
    <br clear="all">
    
    
    <!-- TABS -->
    <div class="tabs" id="tabs-player">
<!--      <div class="tab active" id="tab-news">Мэдээ</div>-->
      <div class="tab active" id="tab-stat">Стат</div>
      <div class="tab" id="tab-avg-stat">Дундаж Стат</div>
      <div class="tab" id="tab-photo">Зураг</div>
      <div class="tab" id="tab-video">Видео</div>
      <hr class="separator"/>
    <!--  <div class="c active" id="tab-news-c">
          <?php //$pager = Doctrine::getTable('News')->getPager(array('objectType'=>''))?>
          <?php //include_partial('content/newslist', array('newss'=>$pager->getResults()));?>
          <br clear="all">
          <?php //echo pager_navigation($pager, 'player/show?nick='.$player->getNick())?>
      </div>-->
      <div class="c" id="tab-avg-stat-c">
          <?php include_partial('player/avg_stat', array('playerId'=>$player->getId(), 'seasonId'=>$activeSeasonId));?>
      </div>
      <div class="c active" id="tab-stat-c">
          <?php include_partial('player/stat', array('playerId'=>$player->getId(),'activeSeasonId'=>$activeSeasonId));?>
      </div>
      <div class="c" id="tab-photo-c">
          <?php include_partial('content/album', array('objectType'=>'player','objectId'=>$player->getId()));?>
      </div>
      <div class="c" id="tab-video-c">
        	<?php include_partial('content/video', array('objectType'=>'player','objectId'=>$player->getId()));?>
      </div>
    </div><!--tabs-->
    
    <br clear="all">

    <?php //include_partial('comment/comments', array('objectType'=>'team', 'objectId'=>$player->getId()));?>
</div>

<?php include_partial('main/right', array());?>

<br clear="all">

